<template>
<!-- 人员发展 - 夕会 -->
  <div class="personal-detail">
    <board-title v-if="isFz()" title="发展" bgclass="bg-fz">
      <img slot="flagImg" class="flag-img" src="~@/assets/imgs/publicline/board/flag_fz.png" />
      <div slot="other-time" class="flag-time">{{ dayId }}</div>
    </board-title>
    <board-title v-if="isWx()" title="维系" bgclass="bg-wx">
      <img slot="flagImg" class="flag-img" src="~@/assets/imgs/publicline/board/flag_wx.png" />
      <div slot="other-time" class="flag-time">{{ dayId }}</div>
    </board-title>
    <board-title v-if="isZj()" title="智家" bgclass="bg-zj">
      <img slot="flagImg" class="flag-img" src="~@/assets/imgs/publicline/board/flag_zj.png" />
      <div slot="other-time" class="flag-time">{{ dayId }}</div>
    </board-title>
    <div class="detail-info">
      <div class="title">{{ title[type] }}</div>
      <div class="info-item">
        <div v-if="isWx() || isZj()" class="value-title">
          <span class="sub-title">今日发展</span>
          <span class="value">{{ value }}<span class="unit">户</span></span>
        </div>
        <div v-else class="value-title">
          <span class="sub-title">今日发展/今日目标</span>
          <span class="value">{{ value }}/{{ mvalue }}<span class="unit">户</span></span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import boardTitle from '@/views/components/publicline/board/title.vue'


export default {
  components: { boardTitle },
  data() {
    return {
      dayId: '',
      type: '',
      value: 0,
      mvalue: 0,
      title: {
        YW: '移网',
        KD: '宽带',
        RH: '融合',
        YQT_XH: '云企通',
        '5GQZ': '5G迁转',
        '5GTSB': '5G升级包',
        KDTSB: '宽带提速包',
        WJGH: '沃家固话',
        WJZW: '沃家组网',
        WJSY: '沃家神眼',
        IPTV: 'IPTV'
      }
    }
  },
  methods: {
    handleData(dayId, type, value, mvalue) {
      this.dayId = dayId
      this.type = type
      this.value = value
      this.mvalue = mvalue
    },
    isFz() {
      const merge = ['YW', 'KD', 'RH', 'YQT_XH']
      return merge.includes(this.type)
    },
    isWx() {
      const merge = ['5GQZ', '5GTSB', 'KDTSB']
      return merge.includes(this.type)
    },
    isZj() {
      const merge = ['WJGH', 'WJZW', 'WJSY', 'IPTV']
      return merge.includes(this.type)
    }
  }
}
</script>